/* Sokoban
 * HIT3243
 * Authors: Mike Blackney, Ben Ingarfield, Kurniawan
 */

#pragma once

// Forward declaration:
class Pawn;

/* Ai Functions
 * 
 * Each function is responsible for a single Pawn, and
 * is called once per update.
 *
 */

struct AiFunction {
	AiFunction( );
	virtual ~AiFunction( );

	void Reset( Pawn* );
	void operator( )( Pawn*, double, float );
	virtual void Position( float, float, float );
	virtual void Ai( Pawn*, double, float ) = 0;
	
	virtual void Collide( Pawn*, Pawn* );
	virtual void Animate( Pawn*, long );
protected:

	float targetX, targetY;
	float dx, dy;
	float theta;

	Pawn* pushing; // The pawn that our pawn is currently pushing.
};

struct PlayerAi : public AiFunction {
	PlayerAi( double );
	virtual void Ai( Pawn*, double, float );

	virtual void Animate( Pawn*, long );
	virtual void Collide( Pawn*, Pawn* );

	static void SetX( float i ) { x = i; }
	static void SetY( float i ) { y = i; }
	static void SetZ( float i ) { z = i; }
	static float GetX( ) { return x; }
	static float GetY( ) { return y; }
	static float GetZ( ) { return z; }
protected:
	// Static position values for use by
	// other Ai routines:
	static float x, y, z;
	double fTimeLanded;
	long facing;
};

